package org.jianfa.mq.seckill.controller;

import org.jianfa.mq.seckill.entity.po.Goods;
import org.jianfa.mq.seckill.entity.vo.Result;
import org.jianfa.mq.seckill.mapper.GoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GoodsListController {

    @Autowired
    private GoodsMapper goodsMapper;

    @GetMapping("/seckill/goodsList")
    public Result<List<Goods>> goodsList() {
        List<Goods> goods = goodsMapper.selectAll();
        return Result.success(goods);
    }
}
